# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=isl

pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=0.12.1
pkgrel=2
pkgdesc="Library for manipulating sets and relations of integer points bounded by linear constraints"
arch=('any')
url="http://freecode.com/projects/isl"
groups=("${MINGW_PACKAGE_PREFIX}")
#depends=("${MINGW_PACKAGE_PREFIX}-gmp")
makedepends=("${MINGW_PACKAGE_PREFIX}-gmp")
options=('staticlibs')
license=('MIT')
source=(http://isl.gforge.inria.fr/${_realname}-${pkgver}.tar.bz2
        #ftp://ftp.linux.student.kuleuven.be/pub/people/skimo/isl/${_realname}-$pkgver.tar.bz2
        isl-0.12.1-no-undefined.patch)
md5sums=('27d381085ff1b5733c3e8a9b6ad24a4d'
         'ca9a6f7dd457cfa1cd33597d23046fe9')

prepare() {
  cd "$srcdir/${_realname}-$pkgver"
  patch -p1 -i ${srcdir}/isl-0.12.1-no-undefined.patch
}

build() {
  cd "$srcdir/${_realname}-$pkgver"
  ./configure --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --enable-static \
    --disable-shared \
    --with-gmp-prefix=${MINGW_PREFIX}
  make
}

check() {
  cd "$srcdir/${_realname}-$pkgver"
  make check
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
}
